package com.class06.springboottest.controller;

import com.class06.springboottest.dao.UsersDao;
import com.class06.springboottest.pojo.Users;
import com.class06.springboottest.utils.ApiResponse;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Tag(name = "支付微服务模块", description = "支付CRUD")
public class UsersController {
    @Autowired
    private UsersDao usersDao;
    @GetMapping("/users/get_all")
    @Operation(summary = "查询所有流水信息", description = "查询支付所有流水方法")
    public ApiResponse getUsers() {
        List<Users> all = usersDao.findAll();
        ApiResponse apiResponse = new ApiResponse();
        apiResponse.setCode(200);
        apiResponse.setMessage("success");
        apiResponse.setData(all);
        return apiResponse;

    }
}
